﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;

namespace ClipperHouse.jQuery.Base
{
	public abstract class JQueryUIControl : JQuery
	{
		public const string UIEffectNameParam = "UIEffectName";
		public const string UIEffectOptionsParam = "UIEffectOptions";
		public const string UIEffectSpeedParam = "UIEffectSpeed";

		public JQueryUIControl()
		{
			// Effect name needs to be first param
			Params.Add(UIEffectNameParam, "");
			// Options needs to be second param
			Params.Add(UIEffectOptionsParam, "");
			// Options needs to be third param
			Params.Add(UIEffectSpeedParam, "");
			this.Speed = "normal";
		}

		protected override void OnLoad(EventArgs e)
		{
			Params[UIEffectNameParam] = this.EffectName;
			Params[UIEffectOptionsParam] = this.OptionsExpression;
			Params[UIEffectSpeedParam] = this.Speed;
			base.OnLoad(e);
		}

		public abstract string EffectName
		{
			get;
		}

		public string Speed
		{
			get;
			set;
		}

		#region Action (hide, show, toggle)
		public override string jQueryMethodName
		{
			get
			{
				return this.Action.ToString().ToLower();
			}
		}

		public UIEffectAction Action
		{
			get;
			set;
		}
		#endregion
	}

	public enum UIEffectAction
	{
		Toggle,
		Hide,
		Show
	}
}
